@font-face {
    font-family: 'BestTen';
    src: url('@/assets/xinJi/font/BestTen-CRT.otf') format('opentype');
}

.top-3 {
    display: inline-block;
    transform: translateY(-10px);
}

.settle-game {
    height: 1058px;
    width: 1411px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: default;
    min-width: 1411px;
    min-height: 1058px;
    flex-shrink: 0;
    pointer-events: auto;

    /* 本局按钮 */
    --lb-switch-game-left: 550px;
    --lb-switch-game-top: 35px;
    --lb-switch-game-width: 240px;
    --lb-switch-game-height: 60px;
    --lb-switch-game-opacity: 0;

    /* 本周按钮 */
    --lb-switch-week-left: 820px;
    --lb-switch-week-top: 35px;
    --lb-switch-week-width: 240px;
    --lb-switch-week-height: 60px;
    --lb-switch-week-opacity: 0;

    /* 赛季按钮 */
    --lb-switch-season-left: 1090px;
    --lb-switch-season-top: 35px;
    --lb-switch-season-width: 240px;
    --lb-switch-season-height: 60px;
    --lb-switch-season-opacity: 0;

    // 演示模式切换按钮
    .demo-toggle {
        position: absolute;
        top: 20px;
        right: 50px;
        background: rgba(255, 165, 0, 0.8);
        color: white;
        padding: 8px 20px;
        border-radius: 20px;
        font-size: 14px;
        cursor: pointer;
        user-select: none;
        z-index: 1010;
        border: 2px solid #ff8c00;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        
        &:hover {
            background: rgba(255, 140, 0, 0.9);
            border-color: #e07600;
        }
    }

    // 背景容器 - 固定尺寸的backgroundBox图片
    .background-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 1411px;
        height: 1058px;
        z-index: 1;

        .background-image {
            position: absolute;
            top: -20px;
            left: 0;
            width: 1351px;
            height: auto;
            min-height: 100%;
            object-fit: contain;
            flex-shrink: 0;
            z-index: -1;
            pointer-events: none;
        }
    }

    // 内容容器 - 保持固定大小，确保指令正常工作
    .content-container {
        position: relative;
        z-index: 2;
        width: 100%;
        height: 100%;
        padding-top: 40px;
        
        // 排行类型切换按钮：可通过 CSS 变量单独控制定位与透明度
        .lb-switch-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.35);
            background: rgba(0, 0, 0, 0.35);
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            user-select: none;
            transition: all .2s ease;
            z-index: 1006;

            &:hover {
                background: rgba(0,0,0,0.5);
                transform: translateY(-1px);
            }
        }

        /* 右上角关闭按钮 */
        .close-btn-floating {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: #f56c6c; /* 红色 */
            color: #fff;
            font-size: 22px;
            line-height: 36px;
            text-align: center;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            z-index: 1010;

            &:hover {
                background: #ff7875;
                transform: translateY(-1px);
            }
        }

        // 空状态样式
        .empty-state {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: #fff;
            
            .empty-icon {
                font-size: 80px;
                margin-bottom: 20px;
            }
            
            .empty-text {
                font-size: 36px;
                font-family: '微软雅黑';
                margin-bottom: 10px;
            }
            
            .empty-sub-text {
                font-size: 24px;
                font-family: '微软雅黑';
                color: #a4b4f8;
            }
        }
    }

    .game-table {
        position: relative;
        border-collapse: separate;
        border-spacing: 0 10px;
        // margin-top: 40px;
        padding: 8px 100px 12px 145px;
        box-sizing: border-box;
        background: transparent;
        table-layout: fixed;
        
        // 从左边滑入的动画
        animation: slideInFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        
        @keyframes slideInFromLeft {
            0% {
                transform: translateX(-100%);
            }
            100% {
                transform: translateX(0);
            }
        }
        
        thead {
            tr {
                th {
                    vertical-align: middle;
                    
                    &.header-rank {
                        width: 180px;
                        color: #a4b4f8;
                        font-size: 24px;
                        font-weight: 500;
                        font-family: 'BestTen';
                        text-align: center;
                    }

                    &.header-avatar {
                        width: 100px;
                        color: #a4b4f8;
                        font-size: 24px;
                        font-weight: 500;
                        font-family: 'BestTen';
                        text-align: center;
                    }

                    &.header-name {
                        width: 150px;
                        color: #a4b4f8;
                        font-size: 24px;
                        font-weight: 500;
                        font-family: 'BestTen';
                        text-align: center;
                    }

                    &.header-units {
                        width: 640px;
                        color: #a4b4f8;
                        font-size: 24px;
                        font-weight: 500;
                        font-family: 'BestTen';
                        text-align: center;
                    }

                    &.header-total-score {
                        width: 245px;
                        color: #fff;
                        font-size: 36px;
                        font-weight: 500;
                        font-family: 'BestTen';
                        text-align: center;
                    }
                    
                    &.header-country {
                        width: 245px;
                        color: #a4b4f8;
                        font-size: 24px;
                        font-weight: 500;
                        font-family: 'BestTen';
                        text-align: center;
                    }
                }

                .victory-text {
                    color: #ffffff;
                    font-size: 48px;
                    font-family: '微软雅黑';
                    text-align: left;
                    font-weight: bold;
                    padding: 0;
                }

                .game-logo {
                    position: absolute;
                    top: 178px;
                    left: 125px;
                    width: (1233px / 4);
                    height: (320px / 4);
                }
            }
        }

        tbody {
            tr.player-row {
                height: 65px;
                background-color: rgba(10, 20, 114, 0.45);
                animation: slideInRowFromLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
                transform: translateX(-100%);
                opacity: 0;
                
                @keyframes slideInRowFromLeft {
                    0% {
                        transform: translateX(-100%);
                        opacity: 0;
                    }
                    100% {
                        transform: translateX(0);
                        opacity: 1;
                    }
                }

                td {
                    padding: 0 10px;
                    vertical-align: middle;
                    height: 65px;
                    
                    &.player-rank {
                        text-align: center;
                        position: relative;
                        font-family: 'BestTen';
                        &.rank-with-bg {
                            .rank-bg {
                                position: absolute;
                                top: 56%;
                                left: 50%;
                                transform: translate(-50%, -50%);
                                width: 100px;
                                height: 83px;
                                object-fit: contain;
                                z-index: 0;
                            }
                        }
                        
                        .rank-number {
                            position: relative;
                            z-index: 1;
                            font-size: 22px;
                            font-weight: bold;
                            color: #fff;
                            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
                        }
                    }

                    &.player-avatar {
                        display: flex;
                        justify-content: center;
                        align-items: center;

                        img {
                            width: 70px;
                            height: 40px;
                            object-fit: cover;
                            border-radius: 4px;
                            border: 2px solid transparent;
                        }
                    }

                    &.player-name {
                        width: 150px;
                        min-width: 150px;
                        max-width: 150px;
                        font-size: 22px;
                        color: #fff;
                        font-family: 'BestTen';
                        padding: 0 10px;
                        vertical-align: middle;
                        
                        .name-text {
                            display: block;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                            width: 130px;
                            text-align: center;
                            line-height: 65px;
                        }
                    }

                    &.player-units {
                        width: 640px;
                        text-align: center;
                        vertical-align: middle;

                        span {
                            display: inline-block;
                            width: 100%;
                            height: 45px;
                            color: #fff;
                            font-size: 32px;
                            font-family: 'BestTen';
                            font-weight: bold;
                            text-align: center;
                            line-height: 35px;
                            letter-spacing: 4px;
                            position: relative;
                            z-index: 5;
                            overflow: hidden;
                            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 
                                       -1px -1px 2px rgba(0, 0, 0, 0.6),
                                       1px -1px 2px rgba(0, 0, 0, 0.6),
                                       -1px 1px 2px rgba(0, 0, 0, 0.6);
                            border: 6px solid;
                            clip-path: polygon(
                                0px 8px,
                                4px 8px,
                                4px 4px,
                                8px 4px,
                                8px 0px,
                                calc(100% - 8px) 0px,
                                calc(100% - 8px) 4px,
                                calc(100% - 4px) 4px,
                                calc(100% - 4px) 8px,
                                100% 8px,
                                100% calc(100% - 8px),
                                calc(100% - 4px) calc(100% - 8px),
                                calc(100% - 4px) calc(100% - 4px),
                                calc(100% - 8px) calc(100% - 4px),
                                calc(100% - 8px) 100%,
                                8px 100%, 
                                8px calc(100% - 4px),
                                4px calc(100% - 4px),
                                4px calc(100% - 8px),
                                0px calc(100% - 8px)
                            );

                            &::before {
                                content: '';
                                display: inline-block;
                                border-radius: 10px;
                                background-color: var(--progress-color, rgb(248, 140, 20));
                                width: calc(100% - 8px);
                                height: calc(100% - 8px);
                                position: absolute;
                                top: 4px;
                                left: 4px;
                                z-index: -1;
                                transform: scaleX(0);
                                transform-origin: left;
                                transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
                                transition-delay: 2.0s;
                            }
                            
                            &.animate-progress::before {
                                transform: scaleX(var(--progress-scale, 0));
                            }

                            &::after {
                                content: '';
                                display: block;
                                border-radius: 8px;
                                background: linear-gradient(180deg,
                                        rgba(0, 0, 0, 0) 0%,
                                        rgb(0, 0, 0, 0.3) 50%,
                                        rgba(0, 0, 0, 0) 100%);
                                width: 100%;
                                height: calc(100% - 4px);
                                position: absolute;
                                top: 2px;
                                left: 0;
                                z-index: -1;
                                opacity: 0.5;
                                transform: scaleX(0);
                                transform-origin: left;
                                transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
                                transition-delay: 2.0s;
                            }
                            
                            &.animate-progress::after {
                                transform: scaleX(var(--progress-scale, 0));
                            }
                        }
                    }

                    &.player-total-score {
                        width: 245px;
                        text-align: center;

                        span {
                            display: inline-block;
                            border-width: 2px;
                            border-color: rgb(12, 72, 204);
                            border-style: solid;
                            border-radius: 10px;
                            width: 203px;
                            height: 47px;
                            font-size: 32px;
                            color: #a4b4f8;
                            font-family: 'BestTen';
                            letter-spacing: 3px;
                            text-align: center;
                            line-height: 38px;
                        }
                    }

                    &.player-country {
                        width: 245px;
                        text-align: center;
                        
                        .country-text {
                            display: inline-block;
                            border-width: 2px;
                            border-color: rgba(255, 255, 255, 0.25);
                            border-style: solid;
                            border-radius: 10px;
                            width: 203px;
                            height: 47px;
                            font-size: 22px;
                            color: #fff;
                            font-family: 'BestTen';
                            letter-spacing: 2px;
                            text-align: center;
                            line-height: 38px;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }
                    }
                }
            }
        }
    }

    // 分页指示器样式
    .pagination-indicator {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        color: #fff;
        font-family: '微软雅黑';
        z-index: 1005;
        
        .page-info {
            font-size: 16px;
            opacity: 0.8;
            background: rgba(0, 0, 0, 0.5);
            padding: 5px 15px;
            border-radius: 15px;
        }
        
        .page-dots {
            display: flex;
            gap: 10px;
            
            .dot {
                width: 14px;
                height: 14px;
                border-radius: 50%;
                background: rgba(255, 255, 255, 0.3);
                transition: all 0.3s ease;
                cursor: pointer;
                &:hover {
                    transform: scale(1.2);
                    background: rgba(255, 255, 255, 0.6);
                }
                
                &.active {
                    background: #007bff;
                    transform: scale(1.35);
                    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
                    &:hover {
                        transform: scale(1.45);
                    }
                }
            }
        }

        .page-info {
            margin-left: 6px;
        }
    }
}

.pagination-indicator .dot.active {
    background-color: #f7a04e;
    transform: scale(1.35);
}


/* 加载状态样式 */
.loading-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    color: white;
    z-index: 10;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 10px;
    font-size: 36px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
